package com.hzj.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hzj.pojo.OrderInfo;
import com.hzj.pojo.vo.user.OrderCountQueryVo;
import com.hzj.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Service
@FeignClient(name = "PROVIDER-ORDER-8003", contextId = "wxyOrderInfoService")
public interface OrderInfoService {

    /**
     * 查询订单表
     *
     * @return
     */
    @PostMapping("/atformapi/order/orderInfo/auth/getStatusList")
    public Result queryOrderInfo();

    /**
     * 排班编号与就诊人id查询orderinfo的id
     */
    @PostMapping("/atformapi/order/orderInfo/auth/submitOrder/{scheduleId}/{patientId}")
    public Result queryByScheduleIdPatientId(@PathVariable int page, @PathVariable int limit, @RequestParam(required = false) Long patientId, @RequestParam(required = false) Integer orderStatus);


    /**
     * 根据page, limit、searchObj:patientId、orderStatus
     */
    @PostMapping("/atformapi/order/orderInfo/auth/{page}/{limit}")
    public Result queryByPageLimit(@PathVariable int page, @PathVariable int limit, @RequestParam(required = false) Long patientId, @RequestParam(required = false) Integer orderStatus);

    /**
     * 根据id查询
     */
    @PostMapping("/atformapi/order/orderInfo/auth/getOrderInfo/{orderId}")
    public OrderInfo queryById(@PathVariable Long orderId);

    /**
     * 根据id删除
     */
    @PostMapping("/atformapi/order/orderInfo/auth/cancelOrder/{orderId}")
    public Result updateById(@PathVariable Long orderId);


    @PostMapping("/atformapi/order/orderInfo/auth/saveOrderInfo")
    boolean saveOrderInfo(@RequestBody OrderInfo orderInfo);

    @PostMapping("/atformapi/order/orderInfo/auth/updateOrderByHosRecordId")
    boolean updateOrderByHosRecordId(@RequestBody OrderInfo orderInfo);

    @PostMapping("/atformapi/order/orderInfo/auth/queryAll/{page}/{limit}")
    public Result queryAll(@PathVariable int page, @PathVariable int limit, @RequestParam(required = false) String patientName, @RequestParam(required = false) String hosname);



    /*HY三表所有的记录数*/
    @PostMapping("/atformapi/order/orderInfo/selectCountOne")
    public Integer selectCountOne();
    @PostMapping("/atformapi/order/orderInfo/selectCountTwo")
    public Integer selectCountTwo();
    @PostMapping("/atformapi/order/orderInfo/selectCountThree")
    public Integer selectCountThree();

    @PostMapping("/atformapi/order/orderInfo/inner/getCountMap")
    public Map<String, Object> getCountMap(@RequestBody OrderCountQueryVo orderCountQueryVo);


}
